import util from '@/network/common/receipt_util.js';
import $ from 'jquery'

let postCfg = {
    // headers: { 'Content-Type': 'application/x-www-form-urlencoded;charset=GB2312' },
    transformRequest: function (data) {
        return $.param(data)
    }
}
let api = {
    'printReceipt': '',//打印小票
}
let res = {};
util.ajax.defaults.headers.post['Content-Type'] = 'application/x-www-form-urlencoded;charset=GB2312';
function printReceipt (BillBody) {
    let p = new Promise(function (resolve, reject) {
        util.ajax.post(api.printReceipt, {
            BillBody: BillBody
        }, postCfg).then(function(res) {
            resolve(res);
        }, function(error) {
            reject(error);
        });
    });
    return p;
}


export default {
    printReceipt
}